package app.web.netant.yuinya;

import cn.lily.com.exception.YaconException;
import cn.lily.web.page.BusinessPage;
import cn.lily.web.widget.sql.TSqlGrid;
import cn.lily.web.widget.standard.TButton;
import cn.lily.web.widget.standard.TButtonPilot;
/**
 * 喵窝数据
 * @author JiaJ
 * @date 2018年6月27日
 *
 */
public class YuiNyaPage extends BusinessPage {

	@Override
	public void page_onLoad() throws YaconException {
		
		TSqlGrid yuiNyaGrid = sqlGrid("yuiNyaGrid");
		
		yuiNyaGrid.setDictTable("LEO_YUINYA_GAL_INFO");
		String sqlString = "select * from ${schema}.LEO_YUINYA_GAL_INFO ";
		yuiNyaGrid.setCommSqlStr(sqlString);
		yuiNyaGrid.setEdit(true);
			
		yuiNyaGrid.createFieldTitle("GAME_ID").setFieldVisible(false);
		yuiNyaGrid.createFieldTitle("GAME_HREF").setFieldVisible(false);
		yuiNyaGrid.createFieldTitle("GAME_NAME");
		yuiNyaGrid.createFieldTitle("GAME_PRO");
		yuiNyaGrid.createFieldTitle("GAME_TYP");
		yuiNyaGrid.createFieldTitle("GAME_DATE");
		yuiNyaGrid.createFieldTitle("GETCHU_URL").setFieldVisible(false);
		yuiNyaGrid.createFieldTitle("STAND_URL").setFieldVisible(false);
		yuiNyaGrid.createFieldTitle("GAME_MEMO").setFieldVisible(false);
		yuiNyaGrid.createFieldTitle("GAME_THUNDER").setFieldVisible(false);
		yuiNyaGrid.createFieldTitle("GAME_FILE_NAM").setFieldVisible(false);
		yuiNyaGrid.createFieldTitle("GAME_FILE_PWD").setFieldVisible(false);
		yuiNyaGrid.createFieldTitle("GAME_YUN_URLS").setFieldVisible(false);

		TButtonPilot yuiNyaPilot = ButtonPilot("yuiNyaPilot");
		yuiNyaPilot.setPilotIco("/widget/buttonPilot.gif");
		yuiNyaPilot.setPilotText("喵窝网站信息");
		
		yuiNyaPilot.addButtons(new TButton("refresh"));
		yuiNyaGrid.setButtonPilot(yuiNyaPilot);
		
		getPage().addElement(yuiNyaGrid);
		
	}
	
	public void refresh() throws YaconException {
		
		TSqlGrid yuiNyaGrid = sqlGrid("yuiNyaGrid");
		
		yuiNyaGrid.setDictTable("LEO_YUINYA_GAL_INFO");
		String sqlString = "select * from ${schema}.LEO_YUINYA_GAL_INFO ";
		yuiNyaGrid.setCommSqlStr(sqlString);
		
		this.setSelfMessage(yuiNyaGrid.getDataElement());
		
	}

}
